package com.tistory.login.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tistory.admin.adminmgr.auth.model.LoginUserInfo;
import com.tistory.common.vo.CommonReq;
import com.tistory.login.dao.LoginDao;
import com.tistory.login.vo.MemberDocuRes;
import com.tistory.login.vo.MemberRes;
import com.tistory.login.vo.MemberSearchInfo;

@Service("LoginServiceImpl")
public class LoginServiceImpl implements LoginService {
	
	@Autowired
	LoginDao loginDao;



	public void setLoginDao(LoginDao loginDao) {
		this.loginDao = loginDao;
	}
	
	
	@Override
	public LoginUserInfo getUser(Map<String,Object> map) throws SQLException {
		
		return loginDao.getUser(map);
	}


	@Override
	public List<MemberRes> getMemberList(CommonReq req) throws SQLException {
		List<MemberRes> memberList = loginDao.getMemberList(req);
		return memberList;
	}


	@Override
	public Integer getMemberListCount(CommonReq req) throws SQLException {
		return  loginDao.getMemberListCount(req);
	}


	@Override
	public Integer insertUserInfo(Map<String, Object> map) throws SQLException {
		// TODO Auto-generated method stub
		return loginDao.insertUserInfo(map);
	}


	@Override
	public Integer updateUserInfo(Map<String, Object> map) throws SQLException {
		// TODO Auto-generated method stub
		return loginDao.updateUserInfo(map);
	}


	@Override
	public MemberSearchInfo getMemberSearch(String userId) throws SQLException {
		// TODO Auto-generated method stub
		return loginDao.getMemberSearch(userId);
	}
	
	@Override
	public Integer deleteUserInfo(Map<String, Object> map) throws SQLException {
		// TODO Auto-generated method stub
		return loginDao.deleteUserInfo(map);
	}
	
	// 회원 문서 저장
	public void insertFileInfo(Map<String,Object> map) throws SQLException{
		// TODO Auto-generated method stub
		 loginDao.insertFileInfo(map);		
	}


	@Override
	public MemberDocuRes getFileInfo(Map<String, Object> map) throws SQLException {
		// TODO Auto-generated method stub
		return loginDao.getFileInfo(map);
	}


}
